<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
function getId(){
	return uniqid();
}

function getResponse($code,$data){
	$res = array();
	switch ($code) {
		case 0:
			$res['code'] = 0;
			$res['msg'] = "成功！";
			break;
		case 1:
			$res['code'] = 1;
			$res['msg'] = $data;
			break;
		case 2:
			$res['code'] = 2;
			$res['msg'] = $data;
			break;
		default:
			$res['code'] = 99;
			$res['msg'] = "未知错误！";
			break;
	}
	$res['data'] = $data;
	return json($res);
}